#include "dialog_date.h"

#include "lcd_driver.h"

DateDialog::DateDialog(HWND parent):Dialog(parent)
{
    name ="Page 1";

    setupWidgets();
    

}

DateDialog::~DateDialog()
{
    cleanWidgets();
}

/** @function setupWidgets
 *  @brief    setwidgets' parent to this
 *            draw widgets
 */
void DateDialog::setupWidgets()
{
    pLable1 =new Lable(this);
    pLable1->name ="Lable 1";
    pLable1->setPosition(30,30);

    pLable2 = new Lable(this);
    pLable2->name ="Lable 2";
    pLable2->setPosition(60,30);
    
    sendMessage(this, MSG_SET_OFFSET, 20, 0);    
}

void DateDialog::cleanWidgets()
{
    delete pLable2;
    delete pLable1;
}

void DateDialog::draw(Rect *r)
{
    pDC->dirty(max(r->x0,rect.x0), max(r->y0,rect.y0), min(r->x1,rect.x1), min(r->y1,rect.y1));
    Widget::draw(r);
}



